public class TestDemo {
    public static void main(String[] args) {
        System.out.println(10>20 && 10/0 == 0);
        System.out.println(10<20 || 10/0 == 0);
    }

    public static void main7(String[] args) {
        System.out.println(10%3);   //1
        System.out.println(-10%3);  //-1
        System.out.println(10%-3);  //1
        System.out.println(-10%-3); //-1
        short a = 128;
        byte b =(byte) a;
        System.out.println(a);
        System.out.println(b);
    }

    public static void main6(String[] args) {
        String str = "123";
        int ret  = Integer.valueOf(str);
        System.out.println(ret+1);
    }

    public static void main5(String[] args) {
        int num = 10;
        String ret = String.valueOf(num);
        System.out.println(ret);

        String ret2 = num+"";
        System.out.println(ret2);
    }

    public static void main4(String[] args) {
//        int a = 10;
//        long b = a;
//        System.out.println(b);

        byte a = 1;
        byte b = 2;
        byte c = (byte)(a + b);//小于4的数字在运算时，会强制进行转换，进行整型提升，int为4字节，byte为1字节，所以要把int转化为byte
        System.out.println(c);

        byte d = 1 + 2;//此时编译器将1+2识别为常量，即为3
        System.out.println(d);

        int e = 1;
        long f = 2;
        int s = (int)(e + f);// int和long进行运算，会提升为long
        System.out.println(s);

    }

    public static void main1(String[] args) {
        short s = 10;
        boolean flag = true;
        System.out.println(s);
        System.out.println(flag);
    }
    public static void main2(String[] args) {
        String str = "hello";
        System.out.println("hello"+10+20);//拼接
        System.out.println("heillo"+"world");
        System.out.println("hello"+(10+20));
        System.out.println(10+20+"hello");
        System.out.println(10+" "+20+"hello");
        System.out.println("a="+10+", b="+20);
        String s1 = "bit";
        System.out.println("\\\\s1\\\\");
    }
    public static void main3(String[] args) {
        final int SIZE; //常量
        SIZE = 99;
        System.out.println(SIZE);
    }
}
